import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;

public class WsClient {

	public static void main(String[] args) throws Exception {
		//调用WebService

		  //不依赖服务器端接口来完成调用的，也就是不仅仅能调用Java的接口

		JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();

		Client client = clientFactory.createClient("http://192.168.20.204:8080/helloWorld?wsdl");

		Object[] result = client.invoke("sayHi", "KEVIN");

		System.out.println(result[0]);
	}
}
